<%@ page language="java" contentType="text/html; charset="
	pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/general/include_head.jsp"%>
<link href="../css/tablas.css" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300&v2"
	rel="stylesheet" type="text/css" />
	
</head>
<body>


<div id="CONTAINER">
  <div class="header">
    <%@ include file="/WEB-INF/jsp/gesfutbol/head.jsp"%> 
  </div>
  <div class="izquierda">
    <div class="izq_header" ></div>
	<div class="izq_content">	  		 
		<%@ include file="/WEB-INF/jsp/usuari/menu_penya.jsp"%>			
	 </div>  
	 <div class="izq_footer"></div> 
  </div>
  
  <div class="principal_todo">
  
   <c:set var="colspan" value="${fn:length(penya.combPropies) + fn:length(penya.combGenerals)}"/>
    
	<table class="lista">
	  <tr>
		<th>Jornada ${quinielaActiva.numJornadaQuiniela }</th>
		<c:forEach items="${llistatPenyistes}" var="penyistes" varStatus="status">
		  <th scope="col" colspan="${colspan}">${penyistes.usuari.alies }</th>
		</c:forEach>
	  </tr>
	  <tr>
    	<th scope="col">Combinaciones: </th>
    		<c:forEach items="${llistatPenyistes}" var="penyistes" varStatus="status">
		    	<c:forEach items="${penya.combPropies}" var="cPropies" varStatus="status">
					<th scope="col">${cPropies.nom}</th>
				</c:forEach>
				<c:forEach items="${penya.combGenerals}" var="cGenerals" varStatus="status">
					<th scope="col">${cGenerals.nom}</th>
				</c:forEach> 
			</c:forEach>
			<c:if test="${fn:length(pronosticsValidats) > 0}">
				<th>Quiniela Validada</th>
			</c:if>  		    
  	</tr>   
	  
 	<c:forEach items="${llistatPartits}" var="partits" varStatus="numPartit">
	  <tr>  
		  <th scope="row">${partits.partit.nomPartit }</th>
			<c:forEach items="${llistatPenyistes}" var="penyista" varStatus="status">										
							<c:forEach items="${penya.combPropies}" var="cPropies" varStatus="status">
								<td  bgcolor="#E9E9E9" style="border:double">
									<c:forEach  items="${penyista.pronostics }" var="pronostic" varStatus="status">
										<c:if test="${pronostic.partitDeQuiniela.idPartitDeQuiniela eq partits.idPartitDeQuiniela }">
											<c:if test="${pronostic.combinacioPropia.idCombinacioPropia eq cPropies.idCombinacioPropia }">
												<c:if test="${pronostic.un == true}">1</c:if>
												<c:if test="${pronostic.ix == true}">X</c:if>
												<c:if test="${pronostic.dos == true}">2</c:if> 
               								</c:if>
               							</c:if>
									</c:forEach>
								</td>	
								</c:forEach>							
							<c:forEach items="${penya.combGenerals}" var="cGenerals" varStatus="status">
							<td  bgcolor="#F5F5F5" style="border:double">
								<c:forEach  items="${penyista.pronostics }" var="pronostic" varStatus="status">
									<c:if test="${pronostic.partitDeQuiniela.idPartitDeQuiniela eq partits.idPartitDeQuiniela }">
										<c:if test="${pronostic.combinacioGeneral.idCombinacioGeneral eq cGenerals.idCombinacioGeneral }">
												<c:if test="${pronostic.un == true}">1</c:if>
												<c:if test="${pronostic.ix == true}">X</c:if>
												<c:if test="${pronostic.dos == true}">2</c:if>               									
										</c:if>
									</c:if>
								</c:forEach>
							</td>
							</c:forEach>
			 </c:forEach>
			 			<c:if test="${fn:length(pronosticsValidats) > 0}">
			 				<td>
			 				<c:forEach items="${pronosticsValidats}" var="pValidat" varStatus="status">
			 					<c:if test="${pValidat.partitDeQuiniela.posicioQuiniela eq numPartit.count }">
			 						<c:if test="${pValidat.un == true}">1</c:if>
									<c:if test="${pValidat.ix == true}">X</c:if>
									<c:if test="${pValidat.dos == true}">2</c:if>
			 					</c:if>
			 				</c:forEach>
			 				</td>
			 			</c:if>			 
	  	</tr>
	</c:forEach>
	</table>
</div>
	
	<div class="footer">
		<h6>
			<fmt:message key="copyright" />
		</h6>
	</div>
</div>
</body>
</html>
